<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>网站信息</title>
		<link rel="stylesheet" href="css/pintuer.css">
		<link rel="stylesheet" href="css/admin.css">
		<script src="js/jquery.js"></script>
		<script src="js/pintuer.js"></script>
		<script type="text/javascript">
			function check(){
				var oFile = document.getElementById('file');
					if (oFile.value == "") {
						alert('请选择格式为jpg格式的图片进行上传！');
						return false;
					}else{
						return true;
					}
				
			}
		
		
			//用于进行图片上传，返回地址
			function setImg(obj) {
				var f = $(obj).val();
				//	alert(f);
				//	console.log(obj);
				if (f == null || f == undefined || f == '') {
					return false;
				}
				//   if(!/\.(?:png|jpg|bmp|gif|PNG|JPG|BMP|GIF)$/.test(f))
				if (!/\.(?:jpg)$/.test(f)) {
					alert("类型必须是图片(.jpg)");
					$(obj).val('');
					return false;
				}
			
			}
		</script>
	</head>
	<body>
		<div class="panel admin-panel">
			<div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 网站信息修改</strong></div>
			<center>
				<font align="center" style="color:red;font-size:20px;">${flag3}</font>
			</center>
			<c:remove var="flag3" />
			<div class="body-content">
				<form method="post" class="form-x" enctype="multipart/form-data" action="updatewebinfo.do" onsubmit="return check()">
					<div class="form-group">
						<div class="label">
							<label>网站标题：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="title" value="${info.title }" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>网站LOGO：</label>
						</div>
						<div class="field">
							<img style="width:100px; height:100px; border-radius:50%;" src="<c:url value='upload/${info.logo }'/>" class="tp" />
							<input type="file" name="logo" value="浏览上传" id="file" onchange="setImg(this);">
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>网站域名：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="dns" value="${info.dns}" />
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>网站描述：</label>
						</div>
						<div class="field">
							<textarea class="input" name="des">${info.des }</textarea>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>联系人：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="name" value="${info.name }" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>手机：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="phone" value="${info.phone}" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>QQ：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="qq" value="${info.qq }" />
							<div class="tips"></div>
						</div>
					</div>


					<div class="form-group">
						<div class="label">
							<label>Email：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="email" value="${info.email }" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>地址：</label>
						</div>
						<div class="field">
							<input type="text" class="input" name="address" value="${info.address }" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>底部信息：</label>
						</div>
						<div class="field">
							<textarea name="binfo" class="input" style="height:120px;">${info.binfo }</textarea>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label></label>
						</div>
						<div class="field">
							<input type="submit" class="button bg-main icon-check-square-o"  value="提交">
						</div>
					</div>
				</form>
			</div>
		</div>
	</body>
</html>
